package com.ilancuo.thinkinjava.chapter_15;

public class ArrayOfGeneric {
    static final int SIZE = 100;
    static Generic<Integer>[] gia;

    public static void main(String[] args) {
//        gia = (Generic<Integer>[]) new Object[SIZE]; //ClassCastException
        gia = (Generic<Integer>[]) new Generic[SIZE];
        System.out.println(gia.getClass().getSimpleName());
        gia[0] = new Generic<>();
//        gia[1] = new Object(); //无法编译
//        gia[2] = new Generic<Double>(); //无法编译
    }
}
